anchor.diff:  
   insert_file(File, Props, PropsMedia, Context) ->
       Mime = proplists:get_value(mime, PropsMedia),
  -    case z_acl:is_allowed(insert, #acl_media{mime=Mime, size=filelib:file_size(File)}, Context) of
  +    case z_acl:is_allowed(insert, #acl_rsc{category=mime_to_category(Mime)}, Context) andalso
  +         z_acl:is_allowed(insert, #acl_media{mime=Mime, size=filelib:file_size(File)}, Context) of
           true ->
               insert_file_mime_ok(File, Props, PropsMedia, Context);
           false ->
  
positive.code:                       [{stream, File}]) of
          {ok, saved_to_file} ->
              {ok, File};
          {error, E} ->
              file:delete(File),
              {error, E}
  
negative.code: 
  replace_file(File, RscId, Props, PropsMedia, Opts, Context) ->
      Mime = proplists:get_value(mime, PropsMedia),
      case z_acl:is_allowed(insert, #acl_rsc{category=mime_to_category(Mime)}, Context) andalso
           z_acl:is_allowed(insert, #acl_media{mime=Mime, size=filelib:file_size(File)}, Context) of
          true ->
              replace_file_mime_ok(File, RscId, Props, PropsMedia, Opts, Context);
          false ->
  