The purpose of the following diploma thesis is to, first and foremost, place the concept of discretion in the system of administrative law. Furthermore we will try to explain the reader that the principle of free discretion is in fact an "exception" from the principle of legality, a relative exception to the most important basic principle of administrative law and generally the main principle of our entire legal system. The discretionary body is supported by law to select the best of a number of possible alternatives based on the weighing up, contemplating and judging the actual situation. A separate administrative act must be issued within the limits and in accordance with the purpose for which the authorization has been given. In case of violations and misconduct, each individual is provided with appropriate legal remedies. The purpose of the diploma work is also to show, on the basis of the court's case-law of the Administrative, Appellate, Supreme and Constitutional Court of the Republic of Slovenia, on the cases of confiscating weapons and weapons' documents and the exercise of police powers in the state border control, the discretion of the administrative body as well as cases of legal judicial decree of a decision that is used when the regulation has already decided in advance what its content must be, in accordance with the established factual situation. The objective of the diploma thesis is to examine the laws in question and to analyze the judgment of the courts to determine whether the extent of the discretion of the competent authority is too great or too small, and to suggest certain solutions for better regulation.