An officer is a member of a group typically in the areas of the military, police, or some other form of authority. In a military service, an officer's typical role is to command and direct, maintain discipline and make plans and provisions for operation. Certain organizations have special criteria in order to achieve the status of officer.
In the Federation Star Fleet, an officer or commissioned officer is an individual who has attended, and graduated from the four-year cadet program of Star Fleet Academy. Upon graduation from the Academy, the cadet is granted a commission appointing him or her to Star Fleet's most junior officer's rank: that of Ensign. Graduating from Star Fleet Academy also gives the Officer a degree in his or her major field of academic study, be it the Pure Sciences, Medicine, Military Science, etc.
Commissioned officers are distinguished from non-commissioned officers and other crewmembers through the use of a rank structure.
In a military service, a commission is an order from the service's supreme authority, such as its Commander in Chief, authorizing an individual to legally hold a military rank, with all the privileges and responsibilities of said rank. A commission usually appoints an individual to hold an officer's rank.
In times of conflict, a temporary commission could appoint an officer to command rank to replace an incapacitated or killed commanding officer.
In situations where contact with Star Fleet is not possible for very extended periods, a commanding officer has the authority to grant commissions to officers under his or her command, or revoke their existing commissions.
In order words, she/he has the authority promote or demote his/her officers.
Commissioned officer rank structure
Star Fleet ranks from lowest to highest: